home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / os2 / ticker2.zip / scripts / showfile.cmd < prev    next >
OS/2 REXX Batch file  |  1996-05-22  |  1KB  |  43 lines

  1. /* script to display a file */
  2.  
  3. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  4. call SysLoadFuncs
  5.  
  6. /* arguments: filename   name of file to be displayed
  7.               startline  line of file to start with (1 means from beginning)
  8.               nrOfLines  nr of lines to display (-1 means all) 
  9.           showtime   0 forever, >0 time in secs, < 0 count 
  10.               color      default is blue
  11.               key        optional: Key for ticker */
  12.  
  13. arg filename startline nrOfLines showtime color
  14.  
  15. if ((startline = 0) | (startline = '')) then startline = 1
  16. if (nrOfLines = '') then nrOfLines = -1
  17. if (showtime = '') then showtime = -1
  18. if (color = '') then color = 'blue'
  19. if (key = '') then key = 'SHOWFILE'
  20.  
  21. /* call addTicker ' 'filename':'startline':'nrOfLines':'showtime'  ', DEBUG1, -3, black */
  22.  
  23. actline = 0
  24.  
  25. do while lines(filename) 
  26.  
  27.   actline = actline + 1; 
  28.   aline = linein(filename)
  29.  
  30.   /* check if message should be shown*/
  31.   if ( \(startline > actline)) then 
  32.   do
  33.     if ((nrOfLines = -1) | (actline < (startline + nrOfLines)) ) then
  34.     do
  35.       call addTicker aline'   ', key actline, showtime, color
  36.     end
  37.   end
  38. end
  39.  
  40. exit
  41.  
  42.  
  43.